﻿using System;
using System.Web.UI;
using Microsoft.Live.ServerControls.VE;

namespace Microsoft.Live.ServerControls.Web
{
    public partial class DataModeOneWay : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!ScriptManager1.IsInAsyncPostBack)
            {
                Map1.Clear();
                //create data
                ShapeLayer layer = new ShapeLayer();
                layer.Title = "client data";
                for (int x=0; x<100; x++)
                {
                    Shape shape = new Shape(ShapeType.Pushpin,new LatLongWithAltitude(0,x));
                    shape.Title = "Shape " + x;
                    shape.Description = "The quick brown fox jumped over the lazy dog.";
                    layer.AddShape(shape);
                }
                Map1.AddShapeLayer(layer);
            }
            LabelInfo.Text = "Page Loaded";
        }

        protected void AsycPostback_Click(object sender, EventArgs e)
        {
            LabelInfo.Text = "Aysc total shapes layers = " + Map1.GetShapeLayerCount();
        }

        protected void FullPostback_Click(object sender, EventArgs e)
        {
            LabelInfo.Text = "Postback total shapes layers = " + Map1.GetShapeLayerCount();
        }
    }
}